import java.util.Locale;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2024-06-11
 * Time: 13:55
 */
class Student{
    private String name;
    private int age;
    private String gander;

    public Student(String name, int age, String gander) {
        this.name = name;
        this.age = age;
        this.gander = gander;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gander='" + gander + '\'' +
                '}';
    }
}

public class Test {
    public int firstUniqChar(String s) {
        int[] count = new int[26];
        for(int i = 0;i<s.length();i++) {
            char ch = s.charAt(i);
            count[ch-'a']++;
        }
        for(int i = 0;i<s.length();i++) {
            char ch = s.charAt(i);
            if(count[ch-'a'] == 1) {
                return i;
            }
        }
        return -1;
    }
    public static void main(String[] args) {
        // Scanner in = new Scanner(System.in);
        // String str1 = in.nextLine();
        // String[] str2 = str1.split(" ");
        // int len = str2[str2.length-1].length();
        // System.out.println(len);

        Scanner in = new Scanner(System.in);
        String str1 = in.nextLine();
        int index = str1.lastIndexOf(' ');
        String str2 = str1.substring(index+1);
        int len = str2.length();
        System.out.println(len);
    }
    private boolean isNumberorCharacter(char ch) {
        if(Character.isDigit(ch)||Character.isLetter(ch)) {
            return true;
        }
        return false;
    }
    public boolean isPalindrome(String s) {
        s = s.toLowerCase();
        int left = 0;
        int right = s.length()-1;
        while(left < right) {
            while(left < right && !isNumberorCharacter(s.charAt(left))) {
                left++;
            }
            while(left < right && !isNumberorCharacter(s.charAt(right))) {
                right--;
            }
            if(s.charAt(left) == s.charAt(right)) {
                left++;
                right--;
            } else {
                return false;
            }
        }
        return true;
    }
    public static void main9(String[] args) {
            StringBuilder sbd1 = new StringBuilder("hello");
            StringBuilder sbd2 = sbd1;
        System.out.println(sbd1.append(' '));
        System.out.println(sbd1.append("world"));
        System.out.println(sbd1.append("123"));
        System.out.println(sbd1 == sbd2);
        System.out.println(sbd1.charAt(1));
        System.out.println(sbd1.length());
        System.out.println(sbd1.capacity());//获取底层保存字符串空间总的大小
        sbd1.setCharAt(0,'H');
        System.out.println(sbd1);
        System.out.println(sbd1.insert(1, "[Hello word!!!]"));
        System.out.println(sbd1.indexOf("Hello"));
        System.out.println(sbd1.lastIndexOf("Hello"));
        System.out.println(sbd1.deleteCharAt(0));
        System.out.println(sbd1.delete(0, 5));//[0,5)

        String str = sbd1.substring(0,5);
        System.out.println(str);

        System.out.println(sbd1.reverse());

        str = sbd1.toString();
        System.out.println(str);
    }
    public static void main8(String[] args) {
        long start = System.currentTimeMillis();
        String s = "";
        for (int i = 0; i < 10000; ++i) {
            s += i;
        }
        long end = System.currentTimeMillis();
        System.out.println(end - start);

        start = System.currentTimeMillis();
        StringBuffer sbf = new StringBuffer("");
        for (int i = 0; i < 10000; ++i) {
            sbf.append(i);
        }
        end = System.currentTimeMillis();
        System.out.println(end - start);

        start = System.currentTimeMillis();
        StringBuilder sbd = new StringBuilder("");
        for (int i = 0; i < 10000; ++i) {
            sbd.append(i);
        }
        end = System.currentTimeMillis();
        System.out.println(end - start);
    }
    public static void main7(String[] args) {
        //字符串的拆分
        String s = "nice to meet you bit";
        String[] s1 = s.split(" ");
        for (String str : s1) {
            System.out.println(str);
        }
        System.out.println("-----");
        String[] s2 = s.split(" ",3);
        for (String str : s2) {
            System.out.println(str );
        }
        //1. 字符"|","*","+"都得加上转义字符，前面加上 "\\" .
        String s3 = "192.168.1.1";
        String[] s4 = s3.split("\\.");
        for(String str : s4){
            System.out.println(str);
        }
        //2. 而如果是 "\" ，那么就得写成 "\\\\" .
        String s5 = "ab\\cd\\ef";
        String[] s6 = s5.split("\\\\");
        for(String str : s6){
            System.out.println(str);
        }
        //3. 如果一个字符串中有多个分隔符，可以用"|"作为连字符.
        String s7 = "sas\\fjsio&dsf";
        String[] s8 = s7.split("\\\\|&");
        for (String str : s8) {
            System.out.println(str);
        }
    }
    public static void main6(String[] args) {
        String s1 = "good morning";
        String s2 = s1.replaceAll("o","r");
        String s3 = s1.replaceFirst("o","r");
        System.out.println(s2);
        System.out.println(s3);
    }
    public static void main5(String[] args) {
        String s1 = new String("HelLo world");
        String s2 = "HeLLO Bit";
        String s3 = s1.toUpperCase();
        String s4 = s2.toLowerCase();
        System.out.println(s3);
        System.out.println(s4);
        System.out.println("---------");
        String s5 = String.format("%d-%d-%d",2024,4,5);
        System.out.println(s5);
    }
    public static void main4(String[] args) {
        //数字转字符串
        String s1 = String.valueOf(123);
        String s2 = String.valueOf(12.3);
        String s3 = String.valueOf(true);
        String s4 = String.valueOf(new Student("hanmeimei",19,"女"));
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(s3);
        System.out.println(s4);
        System.out.println("------");
        //字符串转数字
        int n1 = Integer.parseInt(s1);
        Double d1 = Double.parseDouble("12.23");
        System.out.println(s1 + " " + s2);
    }
    public static void main3(String[] args) {
        String s1 = new String("abcabcda");
        System.out.println(s1.charAt(1));
        System.out.println(s1.indexOf('c'));
        System.out.println(s1.indexOf('c',4));
        System.out.println(s1.indexOf("abc"));
        System.out.println(s1.indexOf("abc",3));
        System.out.println(s1.lastIndexOf('c'));
        System.out.println(s1.lastIndexOf('c',5));
        System.out.println(s1.lastIndexOf("bc"));
        System.out.println(s1.lastIndexOf("bc",2));
    }
    public static void main2(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("hello");
        String s3 = s1;
        String s4 = "Hello";

        System.out.println(s1.compareTo(s2));
        System.out.println(s1.compareTo(s4));
        System.out.println(s1.compareToIgnoreCase(s4));

        System.out.println("-----------");
        System.out.println(s1.length());
        System.out.println("hi".length());
        //equals比较的是对象里面的值
        System.out.println("-----------");
        System.out.println(s1.equals(s2));
        System.out.println(s1.equals(s3));
        System.out.println(s2.equals(s3));
        //内置类型：== 比较的是变量的值
        //引用类型：== 比较的是引用中的地址
        System.out.println("-----------");
        System.out.println(s1 == s2);
        System.out.println(s1 == s3);
        System.out.println(s3 == s2);
    }
    public static void main1(String[] args) {
        String str1 = new String("hi");//使用newString对象
        String str2 = "hello";//使用常量串构造

        //利用字符数组进行构造
        char[] ch = {'s','b','f'};
        String str3 = new String(ch);

        String str4 = str1;
        System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);
        System.out.println(str4);
    }
}
